from tkinter import *
import math as m

root = Tk()

w = Canvas(root,width=200,height=100,scrollregion=(0,0,500,500))
w.pack(fill=BOTH,expand=True)

hscroll = Scrollbar(root,orient=HORIZONTAL)
hscroll.pack(fill='x')

w.config(xscrollcommand=hscroll.set)
hscroll.config(command=w.xview)

center_x = 100
center_y = 50
r=50


point = [
    # 左上点
    center_x - int(r*m.sin(2*m.pi/5)),
    center_y - int(r*m.cos(2*m.pi/5)),
    # 右上点
    center_x + int(r*m.sin(2*m.pi/5)),
    center_y - int(r*m.cos(2*m.pi/5)),
    # 左下角
    center_x - int(r*m.sin(m.pi/5)),
    center_y + int(r*m.cos(m.pi/5)),
    # 顶点
    center_x,
    center_y -r,
    # 右下点
    center_x + int(r*m.sin(m.pi/5)),
    center_y + int(r*m.cos(m.pi/5)),
    
    ]

w.create_polygon(point,outline="green",fill="yellow")

mainloop()
